#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;
const double EPS = 1e-9;

typedef long long ll;

ll sum(ll l, ll r) {
    l %= MOD; r %= MOD;
    ll sr = r * (r + 1) / 2 % MOD;
    ll sl = l * (l - 1) / 2 % MOD;
    ll res =  (sr - sl + MOD) % MOD;
    return res;
}

void solve() {
    ll n; cin >> n;
    ll ans = 0; 
    for (ll l = 1, r; l <= n; l = r + 1) { 
        r = n / (n / l);
        ll ap = sum(l, r);
        ll fl = (n / l) % MOD;
        (ans += ap * fl) %= MOD;
    }
    cout << ans << "\n";
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int tc; tc = 1;
    for (int t = 1; t <= tc; t++) {
        solve();
    }
}
